home *** CD-ROM | disk | FTP | other *** search
- /*
- Dragon.h
-
- Interface to Dragon.c
- */
-
- #include "HandleUtils.h"
- #ifdef DEBUG
- #include "FileUtils.h"
- #endif
-
- class Dragon: indirect {
-
- protected:
- RgnHandle cursorRgn; // For WaitNextEvent
- Boolean running; // Are we or are we not running?
- Boolean autoQuit; // Should we quit when double-clicked, or stick around?
- Boolean menusInstalled; // Do we have working menus?
-
- public:
- Dragon (void); // Constructor
- virtual void Start (void);
- virtual void Run (void);
- virtual OSErr DoOapp (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
- virtual OSErr DoOdoc (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
- virtual OSErr ProcessDroppings (FSSpec **docs, long numDocs);
- virtual void StopRunning (void);
- virtual void Finish (void);
-
- #ifdef DEBUG
- void Test (void);
- #endif
-
- protected:
- virtual void DoEvent (EventRecord *event);
- virtual void DoMouseDown (EventRecord *theEvent);
- virtual void DoMouseUp (EventRecord *theEvent);
- virtual void DoKeyDown (EventRecord *theEvent);
- virtual void DoActivate (EventRecord *theEvent);
- virtual void DoUpdateEvent (EventRecord *theEvent);
- virtual void DoDiskInsert (EventRecord *theEvent);
- virtual void DoOSEvent (EventRecord *theEvent);
- virtual void DoHighLevelEvent (EventRecord *theEvent);
- virtual void DoMenu (long menuItemCode);
- virtual void DoIdle (void);
- virtual void DoSuspend (void);
- virtual void DoResume (void);
- virtual void InitMac (void);
- virtual void InitMilieu (void);
- virtual void InitMem (void);
- virtual void SetUpMenus (void);
- virtual void CallMoreMasters (void);
- virtual void InitAppleEvents (void);
- virtual void Abort (short errNum);
- virtual void Error (short errNum);
- };
-
- extern Dragon *gDragon;
-
- // ---------------- Error codes ----------------
-
- enum {
- eNothingWrong = 1000,
- eNoAppleEvents = 1001,
- eCouldntInstallAppleEvents = 1002,
- eDebugNothingWrong = 2000
- };
-
- // ---------------- Resource constants ----------------
-
- #define rErrorAlert 129
-
- // ---------------- Function prototypes ----------------
-
- void main (void);
- pascal OSErr HandleOapp (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
- pascal OSErr HandleOdoc (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
- pascal OSErr HandlePdoc (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
- pascal OSErr HandleQuit (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
- OSErr GotRequiredParams (AppleEvent *theEvent);
- Dragon *CreateGDragon (void);
-